Imports CHM2Word_Objects
Module Module1
    Dim WithEvents d As clsDecompileAndExport = New clsDecompileAndExport
    Sub Main()
        Try
            Dim args As String() = Environment.GetCommandLineArgs()

            If (args.Length = 1) Then
                Console.WriteLine("Argument : <namefile>")
                Exit Sub
            End If

            Dim file As String = Environment.GetCommandLineArgs(1)
            'file = file.Replace("""", "")
            Console.WriteLine(file)
            
            
            'please write here a chm file to be exported
            d.DecompileAndExport(file)
            Console.WriteLine("end....")

        Catch ex As Exception
            Console.WriteLine(ex.Message)
            Console.WriteLine(ex.StackTrace)
        End Try


    End Sub

    Private Sub d_ProcessFileIntoWord(ByVal sender As Object, ByVal e As CHM2Word_Objects.ProcessFileEventArgs) Handles d.ProcessFileIntoWord
        Console.WriteLine(e.FileNameProcessed & " ... " & e.FileNumberProcessed)
    End Sub
End Module
